﻿namespace Citi.EmailSender.Domain.Mapping
{
    public class EmailReceiverMap : EntityMap<EmailReceiver>
    {
        public EmailReceiverMap()
        {
            Property(x => x.EmailAddressId, m => m.NotNullable(true));
            Property(x => x.EmailId, m => m.NotNullable(true));
            Property(x => x.Type, m => m.NotNullable(true));

            ManyToOne(x => x.Email, m => { m.Column("EmailId"); m.Update(false); m.Insert(false); });
            ManyToOne(x => x.EmailAddress, m => { m.Column("EmailAddressId"); m.Update(false); m.Insert(false); });
        }
    }
}
